﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Site.Master" AutoEventWireup="true" CodeBehind="projecttypemanage.aspx.cs" Inherits="聚欣订单分析.projecttypemanage" %>
<%@ Register Assembly="DevExpress.Web.v18.1, Version=18.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_NAV" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_Contents" runat="server">
    <div class="MainContent">
               <table>
                    <tr>
                        <td>
                            <dx:ASPxButton ID="btnAdd" runat="server" Text="新增产品" OnClick="btnAdd_Click"></dx:ASPxButton>
                        </td>
                    </tr>
                </table>
                <dx:ASPxGridView ID="ASPxGridView1" runat="server" OnRowValidating="ASPxGridView1_RowValidating" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="600px" KeyFieldName="ID">
                    <Columns>
                        <dx:GridViewDataTextColumn FieldName="ID" ReadOnly="True" VisibleIndex="0" Width="50px">
                            <EditFormSettings Visible="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn Caption="产品类型" FieldName="productValue" VisibleIndex="2">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewCommandColumn Caption="编辑" VisibleIndex="13" Width="40px" ShowEditButton="true" ShowUpdateButton="true" ShowCancelButton="true" ShowDeleteButton="true">
                            </dx:GridViewCommandColumn>
                    </Columns>
                    <SettingsBehavior ConfirmDelete="true" />
                    <SettingsText FilterBarClear=" " FilterBarCreateFilter="自定义查询" GroupPanel="将列标题拖拽此处可以分组统计" ConfirmDelete="删除会影响项目信息，确认删除吗？" />
                    <SettingsPager PageSize="20" AlwaysShowPager="True">
                    </SettingsPager>
                </dx:ASPxGridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:JXDDConnectionString %>"
                    DeleteCommand="DELETE FROM [productmanage] WHERE [ID] = @ID"
                    InsertCommand="INSERT INTO [productmanage] ([productType], [productValue]) VALUES (@productValue, @productValue)" SelectCommand="SELECT * FROM [productmanage] ORDER BY [ID] DESC"
                    UpdateCommand="UPDATE [productmanage] SET [productValue] = @productValue WHERE [ID] = @ID">
                    <DeleteParameters>
                        <asp:Parameter Name="ID" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="productValue" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="productValue" Type="String" />
                        <asp:Parameter Name="ID" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </div>
</asp:Content>
